

<!-- Start of first page -->
<div data-role="page">
		<div data-role="header" data-theme="b">
			<h1>iLook-掌上新闻</h1>
			<?php 
			echo CHtml::link("首页",array("site/index"),array("data-role"=>"button","data-icon"=>"home",'rel'=>'external'));
			if(yii::app()->user->isGuest){
				echo CHtml::link("登陆",array("site/login"),array("data-icon"=>"star"));}
			else {
				echo CHtml::link("注销",array("site/logout"),array("data-icon"=>"delete"));
			}?>
			
		</div>
		<!-- /header -->
		<div data-role="footer">
		<div data-role="navbar" data-theme="e" >
			<ul>
				<li><?php echo CHtml::link("最新",array("news/list"),array("data-icon"=>"info","data-theme"=>"b"))?></li>
				<li><?php echo CHtml::link("分类",array("news/category"),array("data-icon"=>"grid","data-theme"=>"e"))?></li>
				<li><?php echo CHtml::link("用户",array("user/index"),array("data-icon"=>"star","data-theme"=>"b"))?></li>
				<li><?php echo CHtml::link("地图",array("site/index#sitemap"),array("data-icon"=>"search","data-theme"=>"b",'rel'=>'external'))?></li>
			</ul>
		</div><!-- /navbar -->
		</div><!-- /footer -->
		
		<div class="content-primary">
			<ul data-role="listview" id="listview" data-theme="d">
			<?php foreach ($newsies as $news):?>
				<li>
				<a href="<?php echo Yii::app()->createUrl('news/list', array('id'=>$news->id)); ?> ">			
				<?php echo CHtml::image(Yii::app()->baseUrl."/images/news/$news->id.png","新加坡$news->title");?>
						<b><?php echo $news->title;?> </b> <br /> <span
					class='description'> <?php 
					$words_count=Utils::getWordCount();
					echo mb_substr($news->description, 0,$words_count,"UTF-8");
					echo"<br/>";
					if(mb_strlen($news->description,"UTF-8")>$words_count*2){
						echo mb_substr($news->description, $words_count,$words_count-3,"UTF-8")."...";
					}else{
						echo mb_substr($news->description, $words_count,$words_count-3,"UTF-8");
					}
					?> </span> </a>
				</li>
			<?php endforeach;?>
			</ul>
		</div>
		<!--/content-primary -->

		<?php $this->renderPartial("//site/footer")?>
		<!-- /footer -->
</div>
<!-- /page -->

